/*
 * Copyright (C) 2012-2013 Matthias Zeimer and the miniframes project group.
 * All rights reserved. 
 * 
 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.opensource.org/licenses/EPL-1.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package de.miniframes.minivalues;

/**
 * <p>
 * This error indicates the use of a not permitted type for a property of a
 * value class. For permitted property types refer <a
 * href="Value.html#fieldrules">value class field rules</a>.
 * </p>
 * 
 * <p>
 * Unless otherwise noted, passing a null argument to any method may result in a
 * {@link NullPointerException}.
 * </p>
 * 
 * @author Matthias Zeimer
 * @version 1
 * @since 0.1, 18.09.2013
 */
public final class NotPermittedPropertyTypeError extends Error {

    /**
     * 
     */
    private static final long serialVersionUID = -355343658566018465L;
    private final Class<? extends Object> notPermittedType;

    /**
     * 
     */
    public NotPermittedPropertyTypeError(
            final Class<? extends Object> notPermittedType)
            throws NullPointerException {
        super("The type " + notPermittedType.getName()
                + " is not permitted for a value.");
        this.notPermittedType = notPermittedType;
    }

    /**
     * @return the notPermittedType
     */
    public Class<? extends Object> getNotPermittedType() {
        return this.notPermittedType;
    }

}
